<?php

namespace App\Http\Controllers\API;

use App\Http\Controllers\AppBaseController;
use App\Models\TaxiReleaseInfo;
use Illuminate\Http\Request;

class TaxiController extends AppBaseController
{
    /**
     * 查询出租车运行记录
     *
     * @param Request $request
     * @return mixed
     */
    public function query(Request $request)
    {

        $info = TaxiReleaseInfo::where('id', '>', 1)
            ->withTrashed();

        if ($request->has('vpl_number')) {
            $info = $info->where('vpl_number', 'like', '%' . $request->get('vpl_number') . '%');
        }

        $info = $info->orderBy("created_at","desc")->paginate($request->limit);
        return $this->sendResponse($info->toArray(),'请求成功');
    }
}
